package lab02.test11;

/**
 * Created by 123 on 2017/10/17.
 */
public class Rectangle implements Printx {
    int length;
    int width;

    public int area() {
        int area = this.length * this.width;
        System.out.println(area);
        return area;
    }

    public int perimeter() {
        int perimeter = 2 * (this.width + this.length);
        System.out.println(perimeter);
        return perimeter;
    }

    @Override
    public void printMyWay() {
        System.out.println("长" + this.length + "宽" + this.width + "周长" + this.perimeter() + "面积" + this.area());
    }
}
